home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / Generators / C / code_windows.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-17  |  14.8 KB  |  442 lines

  1. /// Includes
  2. #define INTUI_V36_NAMES_ONLY
  3.  
  4. #include <exec/types.h>                 // exec
  5. #include <exec/lists.h>
  6. #include <exec/nodes.h>
  7. #include <dos/dos.h>                    // dos
  8. #include <dos/dostags.h>
  9. #include <intuition/intuition.h>        // intuition
  10. #include <libraries/gadtools.h>         // libraries
  11. #include <clib/exec_protos.h>           // protos
  12. #include <clib/dos_protos.h>
  13. #include <pragmas/exec_pragmas.h>       // pragmas
  14. #include <pragmas/dos_pragmas.h>
  15.  
  16. #include <string.h>
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <ctype.h>
  20.  
  21. #include "DEV_IE:Generators/defs.h"
  22. #include "DEV_IE:Include/IEditor.h"
  23. #include "DEV_IE:Generators/C/Protos.h"
  24. ///
  25.  
  26. /// WriteOpenWnd
  27. void WriteOpenWnd( struct GenFiles *Files, struct IE_Data *IE )
  28. {
  29.     struct WindowInfo  *wnd;
  30.     struct GadgetInfo  *gad;
  31.     UWORD               cnt = 0;
  32.  
  33.     for( wnd = IE->win_list.mlh_Head; wnd->wi_succ; wnd = wnd->wi_succ ) {
  34.  
  35.     FPrintf( Files->XDef, "extern LONG Open%sWindow( void );\n"
  36.                   "extern void Close%sWindow( void );\n",
  37.          wnd->wi_Label, wnd->wi_Label );
  38.  
  39.     if(!( wnd->wi_NoOpenWnd )) { // supplied by an expander?
  40.  
  41.         FPrintf( Files->Std, "\nLONG Open%sWindow( void )\n"
  42.                  "{\n"
  43.                  "\tLONG\t\tret_code = NULL;\n"
  44.                  "\tstruct Gadget\t*g;\n",
  45.              wnd->wi_Label );
  46.  
  47.         if( wnd->wi_NumGads ) {
  48.         if( wnd->wi_NumBools )
  49.             if( wnd->wi_IDCMP & IDCMP_GADGETHELP )
  50.             FPuts( Files->Std, "\tint\t\tc;\n" );
  51.             else
  52.             FPuts( Files->Std, "\tint\t\tc;\n" );
  53.         }
  54.  
  55.         if( IE->SrcFlags & FONTSENSITIVE )
  56.         FPrintf( Files->Std, "\n\tComputeFont( %ld, %ld );\n",
  57.              wnd->wi_Width - ( IE->ScreenData->XOffset + IE->ScreenData->Screen->WBorRight  ),
  58.              wnd->wi_Height - ( IE->ScreenData->YOffset + IE->ScreenData->Screen->WBorBottom ));
  59.  
  60.         if(( IE->SrcFlags & LOCALIZE ) && ( wnd->wi_Tags & ( W_LOC_TITLE | W_LOC_SCRTITLE | W_LOC_GADGETS | W_LOC_MENUS | W_LOC_TEXTS ))) {
  61.  
  62.         FPrintf( Files->Std, "\n\tif(!( Localized[ %ld ] )) {\n", cnt );
  63.  
  64.         if(( wnd->wi_Titolo[0] ) && ( wnd->wi_Tags & W_LOC_TITLE ))
  65.             FPrintf( Files->Std, "\n\t\t%sWTags[ 9 ].ti_Data = (ULONG)CatCompArray[ %sWTags[ 9 ].ti_Data ].cca_Str;\n",
  66.                  wnd->wi_Label, wnd->wi_Label );
  67.  
  68.         if(( wnd->wi_TitoloSchermo[0] ) && ( wnd->wi_Tags & W_LOC_SCRTITLE ))
  69.             FPrintf( Files->Std, "\n\t\tULONG *tg;\n"
  70.                      "\t\ttg = (ULONG *)&%sWTags[0];\n"
  71.                      "\t\twhile( *tg++ != WA_ScreenTitle );\n"
  72.                      "\t\t*tg = (ULONG)CatCompArray[ *tg ].cca_Str;\n",
  73.                  wnd->wi_Label );
  74.  
  75.         if( wnd->wi_Tags & W_LOC_GADGETS ) {
  76.             struct GadgetBank  *bank;
  77.  
  78.             if( wnd->wi_NumGads - wnd->wi_NumBools ) {
  79.  
  80.             FPrintf( Files->Std, "\n\t\tLocalizeGadgets( &%sNGad[0], &%sGTags[0], &%sGTypes[0], %s_CNT );\n",
  81.                  wnd->wi_Label, wnd->wi_Label,
  82.                  wnd->wi_Label, wnd->wi_Label );
  83.  
  84.             for( gad = wnd->wi_Gadgets.mlh_Head; gad->g_Node.ln_Succ; gad = gad->g_Node.ln_Succ )
  85.                 if(( gad->g_Kind == LISTVIEW_KIND ) && ( gad->g_NumScelte ))
  86.                 FPrintf( Files->Std, "\t\tLocalizeList( &%sList );\n",
  87.                      gad->g_Label );
  88.             }
  89.  
  90.             for( bank = wnd->wi_GBanks.mlh_Head; bank->Node.ln_Succ; bank = bank->Node.ln_Succ ) {
  91.  
  92.             FPrintf( Files->Std, "\n\t\tLocalizeGadgets( &%sNGad[0], &%sGTags[0], &%sGTypes[0], %s_CNT );\n",
  93.                  bank->Label, bank->Label, bank->Label, bank->Label );
  94.  
  95.             for( gad = bank->Storage.mlh_Head; gad->g_Node.ln_Succ; gad = gad->g_Node.ln_Succ )
  96.                 if(( gad->g_Kind == LISTVIEW_KIND ) && ( gad->g_NumScelte ))
  97.                 FPrintf( Files->Std, "\t\tLocalizeList( &%sList );\n", gad->g_Label );
  98.             }
  99.         }
  100.  
  101.  
  102.         if(( wnd->wi_NumTexts ) && ( wnd->wi_Tags & W_LOC_TEXTS ))
  103.             FPrintf( Files->Std, "\n\t\tLocalizeITexts( &%sIText[0], %ld );\n",
  104.                  wnd->wi_Label, wnd->wi_NumTexts );
  105.  
  106.         if(( wnd->wi_NumMenus ) && ( wnd->wi_Tags & W_LOC_MENUS ))
  107.             FPrintf( Files->Std, "\n\t\tLocalizeMenus( &%sNewMenu[0] );\n",
  108.                  wnd->wi_Label );
  109.  
  110.         FPuts( Files->Std, "\t}\n" );
  111.         }
  112.  
  113.         if( wnd->wi_NumGads ) {
  114.  
  115.         FPrintf( Files->Std, "\n\tg = MakeGadgets( &%sGList, %sGadgets, %sNGad,\n"
  116.                      "\t\t%sGTypes, %sGTags, %s_CNT );\n"
  117.                      "\tif( (LONG)g < 0 )\n"
  118.                      "\t\treturn( -((LONG)g) );\n",
  119.              wnd->wi_Label, wnd->wi_Label, wnd->wi_Label,
  120.              wnd->wi_Label, wnd->wi_Label, wnd->wi_Label );
  121.  
  122.         if( wnd->wi_NumBools ) {
  123.  
  124.             gad = wnd->wi_Gadgets.mlh_Head;
  125.             while( gad->g_Kind != BOOLEAN )
  126.             gad = gad->g_Node.ln_Succ;
  127.  
  128.             if( wnd->wi_IDCMP & IDCMP_GADGETHELP ) {
  129.             if( IE->SrcFlags & FONTSENSITIVE )
  130.                 FPrintf( Files->Std, "\tg = &%sGadget;\n"
  131.                            "\tfor( c = 0; c < %ld; c++ ) {\n"
  132.                            "\t\tg->BoundsLeftEdge = g->LeftEdge = XOffset + ScaleX( g->LeftEdge );\n"
  133.                            "\t\tg->BoundsTopEdge  = g->TopEdge  = YOffset + ScaleY( g->TopEdge );\n",
  134.                    gad->g_Label, wnd->wi_NumBools );
  135.             else
  136.                 FPrintf( Files->Std, "\tg = &%sGadget;\n"
  137.                            "\tfor( c = 0; c < %ld; c++ ) {\n"
  138.                            "\t\tg->LeftEdge       += XOffset;\n"
  139.                            "\t\tg->TopEdge        += YOffset;\n"
  140.                            "\t\tg->BoundsLeftEdge += XOffset;\n"
  141.                            "\t\tg->BoundsTopEdge  += YOffset;\n",
  142.                    gad->g_Label, wnd->wi_NumBools );
  143.             } else {
  144.             if( IE->SrcFlags & FONTSENSITIVE )
  145.                 FPrintf( Files->Std, "\tg = &%sGadget;\n"
  146.                            "\tfor( c = 0; c < %ld; c++ ) {\n"
  147.                            "\t\tg->LeftEdge = XOffset + ScaleX( g->LeftEdge );\n"
  148.                            "\t\tg->TopEdge  = YOffset + ScaleY( g->TopEdge );\n",
  149.                    gad->g_Label, wnd->wi_NumBools );
  150.             else
  151.                 FPrintf( Files->Std, "\tg = &%sGadget;\n"
  152.                            "\tfor( c = 0; c < %ld; c++ ) {\n"
  153.                            "\t\tg->LeftEdge += XOffset;\n"
  154.                            "\t\tg->TopEdge  += YOffset;\n",
  155.                    gad->g_Label, wnd->wi_NumBools );
  156.             }
  157.  
  158.             if(( IE->SrcFlags & LOCALIZE ) && ( wnd->wi_Tags & W_LOC_GADGETS ))
  159.             FPrintf( Files->Std, "\t\tif( g->GadgetText )\n"
  160.                          "\t\t\tif(!( Localized[ %ld ] ) && ( g->GadgetText->IText ))\n"
  161.                          "\t\t\t\tg->GadgetText->IText = (UBYTE *)CatCompArray[ (ULONG)g->GadgetText->IText ].cca_Str;\n",
  162.                  cnt );
  163.  
  164.             FPuts( Files->Std, "\t\tg = g->NextGadget;\n"
  165.                        "\t}\n" );
  166.  
  167.             gad = wnd->wi_Gadgets.mlh_TailPred;
  168.             while( gad->g_Kind != BOOLEAN )
  169.             gad = gad->g_Node.ln_Pred;
  170.  
  171.             FPrintf( Files->Std, "\t%sGadget.NextGadget = %sGList;\n",
  172.                  gad->g_Label, wnd->wi_Label );
  173.         }
  174.         }
  175.  
  176.         if( wnd->wi_NumMenus )
  177.         FPrintf( Files->Std, "\tif(!( %sMenus = CreateMenus( %sNewMenu, TAG_END )))\n"
  178.                      "\t\treturn( 3L );\n\n"
  179.                      "\tLayoutMenus( %sMenus, VisualInfo, GTMN_NewLookMenus, TRUE, TAG_END );\n\n",
  180.              wnd->wi_Label, wnd->wi_Label, wnd->wi_Label );
  181.     }
  182.  
  183.  
  184.  
  185.     // Gadget Banks
  186.     {
  187.         struct GadgetBank  *bank;
  188.         ULONG               count = 0;
  189.  
  190.         for( bank = wnd->wi_GBanks.mlh_Head; bank->Node.ln_Succ; bank = bank->Node.ln_Succ ) {
  191.         if( bank->Node.ln_Type & GB_ONOPEN ) {
  192.  
  193.             FPrintf( Files->Std, "\t{\n"
  194.                      "\t\tstruct Gadget\t*gad;\n"
  195.                      "\t\tgad = MakeGadgets( &%sGList, %sGadgets, %sNGad,\n"
  196.                      "\t\t\t%sGTypes, %sGTags, %s_CNT );\n"
  197.                      "\t\tif( (LONG)gad < 0 )\n"
  198.                      "\t\t\treturn( -((LONG)gad) );\n"
  199.                      "\t\t%sWBanks.Banks[%ld] = g->NextGadget = %sGList;\n"
  200.                      "\t\tg = gad;\n"
  201.                      "\t}\n",
  202.                  bank->Label, bank->Label, bank->Label, bank->Label,
  203.                  bank->Label, bank->Label, wnd->wi_Label, count++,
  204.                  bank->Label );
  205.         }
  206.         }
  207.  
  208.         if( count )
  209.         FPrintf( Files->Std, "\t%sWBanks.Count = %ld;\n",
  210.              wnd->wi_Label, count );
  211.     }
  212.  
  213.  
  214.  
  215.     // Expanders
  216.     IE->win_info = wnd;
  217.     ( *IE->IEXSrcFun->OpenWnd )( Files );
  218.  
  219.     if(!( wnd->wi_NoOpenWnd )) {
  220.  
  221.         FPuts( Files->Std, (( IE->SrcFlags & SHARED_PORT ) && ( wnd->wi_Tags & W_SHARED_PORT )) ?
  222.                    "\tret_code = OpenWndShd( " : "\tret_code = OpenWnd( " );
  223.  
  224.         if( wnd->wi_NumGads )
  225.         if( wnd->wi_NumBools ) {
  226.             gad = wnd->wi_Gadgets.mlh_Head;
  227.             while( gad->g_Kind != BOOLEAN )
  228.             gad = gad->g_Node.ln_Succ;
  229.             FPrintf( Files->Std, "&%sGadget", gad->g_Label );
  230.         } else {
  231.             FPrintf( Files->Std, "%sGList", wnd->wi_Label );
  232.         }
  233.         else
  234.         FPuts( Files->Std, Null );
  235.  
  236.         FPrintf( Files->Std, ", %sWTags, &%sWnd",
  237.              wnd->wi_Label, wnd->wi_Label );
  238.  
  239.         if(( IE->SrcFlags & SHARED_PORT ) && ( wnd->wi_Tags & W_SHARED_PORT ))
  240.         FPrintf( Files->Std, ", %s_IDCMP", wnd->wi_Label );
  241.  
  242.         FPuts( Files->Std, " );\n"
  243.                    "\tif( ret_code )\n"
  244.                    "\t\treturn( ret_code );\n" );
  245.  
  246.         if( wnd->wi_NumMenus )
  247.         FPrintf( Files->Std, "\tSetMenuStrip( %sWnd, %sMenus );\n",
  248.              wnd->wi_Label, wnd->wi_Label );
  249.  
  250.         if( wnd->wi_NeedRender )
  251.         FPrintf( Files->Std, "\n\t%sRender();\n", wnd->wi_Label );
  252.  
  253.         if(( IE->SrcFlags & LOCALIZE ) && ( wnd->wi_Tags & ( W_LOC_TITLE | W_LOC_SCRTITLE | W_LOC_GADGETS | W_LOC_MENUS | W_LOC_TEXTS )))
  254.         FPrintf( Files->Std, "\n\tLocalized[ %ld ] = TRUE;\n", cnt );
  255.  
  256.         FPuts( Files->Std, "\treturn( 0L );\n}\n\n" );
  257.     }
  258.  
  259.     FPrintf( Files->Std, "void Close%sWindow( void )\n"
  260.                  "{\n",
  261.          wnd->wi_Label );
  262.  
  263.     if( wnd->wi_NumBools )
  264.         if( wnd->wi_IDCMP & IDCMP_GADGETHELP )
  265.         FPuts( Files->Std, "\tstruct ExtGadget\t*g;\n"
  266.                    "\tint\t\tc;\n" );
  267.         else
  268.         FPuts( Files->Std, "\tstruct Gadget\t*g;\n"
  269.                    "\tint\t\tc;\n" );
  270.  
  271.     FPrintf( Files->Std, (( IE->SrcFlags & SHARED_PORT ) && ( wnd->wi_Tags & W_SHARED_PORT )) ?
  272.          "\n\tCloseWndShd( &%sWnd, " : "\n\tCloseWnd( &%sWnd, ", wnd->wi_Label );
  273.  
  274.     if( wnd->wi_NumGads - wnd->wi_NumBools )
  275.         FPrintf( Files->Std, "&%sGList, ", wnd->wi_Label );
  276.     else
  277.         FPuts( Files->Std, "NULL, " );
  278.  
  279.     if( wnd->wi_NumMenus )
  280.         FPrintf( Files->Std, "&%sMenus", wnd->wi_Label );
  281.     else
  282.         FPuts( Files->Std, Null );
  283.  
  284.     FPuts( Files->Std, " );\n" );
  285.  
  286.     if( wnd->wi_NumBools ) {
  287.  
  288.         gad = wnd->wi_Gadgets.mlh_Head;
  289.         while( gad->g_Kind != BOOLEAN )
  290.         gad = gad->g_Node.ln_Succ;
  291.  
  292.         if( wnd->wi_IDCMP & IDCMP_GADGETHELP ) {
  293.         if( IE->SrcFlags & FONTSENSITIVE )
  294.             FPrintf( Files->Std, "\tg = &%sGadget;\n"
  295.                        "\tfor( c = 0; c < %ld; c++ ) {\n"
  296.                        "\t\tg->BoundsLeftEdge = g->LeftEdge = (((( g->LeftEdge - XOffset ) * %ld ) - %ld ) / FontX);\n"
  297.                        "\t\tg->BoundsTopEdge  = g->TopEdge  = (((( g->TopEdge  - YOffset ) * %ld ) - %ld ) / FontY);\n"
  298.                        "\t\tg = g->NextGadget;\n"
  299.                        "\t}\n",
  300.                gad->g_Label, wnd->wi_NumBools,
  301.                IE->ScreenData->Screen->RastPort.Font->tf_XSize,
  302.                IE->ScreenData->Screen->RastPort.Font->tf_XSize >> 1,
  303.                IE->ScreenData->Screen->RastPort.Font->tf_YSize,
  304.                IE->ScreenData->Screen->RastPort.Font->tf_XSize >> 1 );
  305.         else
  306.             FPrintf( Files->Std, "\tg = &%sGadget;\n"
  307.                        "\tfor( c = 0; c < %ld; c++ ) {\n"
  308.                        "\t\tg->LeftEdge       -= XOffset;\n"
  309.                        "\t\tg->TopEdge        -= YOffset;\n"
  310.                        "\t\tg->BoundsLeftEdge -= XOffset;\n"
  311.                        "\t\tg->BoundsTopEdge  -= YOffset;\n"
  312.                        "\t\tg = g->NextGadget;\n"
  313.                        "\t}\n",
  314.                gad->g_Label, wnd->wi_NumBools );
  315.         } else {
  316.         if( IE->SrcFlags & FONTSENSITIVE )
  317.             FPrintf( Files->Std, "\tg = &%sGadget;\n"
  318.                        "\tfor( c = 0; c < %ld; c++ ) {\n"
  319.                        "\t\tg->LeftEdge = (((( g->LeftEdge - XOffset ) * %ld ) - %ld ) / FontX);\n"
  320.                        "\t\tg->TopEdge  = (((( g->TopEdge  - YOffset ) * %ld ) - %ld ) / FontY);\n"
  321.                        "\t\tg = g->NextGadget;\n"
  322.                        "\t}\n",
  323.                gad->g_Label, wnd->wi_NumBools,
  324.                IE->ScreenData->Screen->RastPort.Font->tf_XSize,
  325.                IE->ScreenData->Screen->RastPort.Font->tf_XSize >> 1,
  326.                IE->ScreenData->Screen->RastPort.Font->tf_YSize,
  327.                IE->ScreenData->Screen->RastPort.Font->tf_XSize >> 1 );
  328.         else
  329.             FPrintf( Files->Std, "\tg = &%sGadget;\n"
  330.                        "\tfor( c = 0; c < %ld; c++ ) {\n"
  331.                        "\t\tg->LeftEdge -= XOffset;\n"
  332.                        "\t\tg->TopEdge  -= YOffset;\n"
  333.                        "\t\tg = g->NextGadget;\n"
  334.                        "\t}\n",
  335.                gad->g_Label, wnd->wi_NumBools );
  336.         }
  337.     }
  338.  
  339.     // Expanders
  340.     ( *IE->IEXSrcFun->CloseWnd )( Files );
  341.  
  342.     FPuts( Files->Std, "\n}\n" );
  343.  
  344.     cnt += 1;
  345.     }
  346. }
  347. ///
  348. /// WriteOpenWndShd
  349. void WriteOpenWndShd( struct GenFiles *Files, struct IE_Data *IE )
  350. {
  351.     FPuts( Files->Std, "LONG OpenWndShd( struct Gadget *GList, struct TagItem *WTags, struct Window **Wnd, ULONG IDCMP )\n"
  352.                "{\n"
  353.                "\tUWORD\t\ttc;\n" );
  354.  
  355.     if( IE->SrcFlags & FONTSENSITIVE )
  356.     FPuts( Files->Std, "\tUWORD\t\tww, wh, oldww, oldwh;\n" );
  357.  
  358.     FPuts( Files->Std, "\n\tif( GList ) {\n"
  359.                "\t\ttc = 0;\n"
  360.                "\t\twhile( WTags[ tc ].ti_Tag != WA_Gadgets ) tc++;\n"
  361.                "\t\tWTags[ tc ].ti_Data = (ULONG)GList;\n"
  362.                "\t}\n\n" );
  363.  
  364.     if( IE->SrcFlags & FONTSENSITIVE )
  365.     FPuts( Files->Std, "\tww = ScaleX( WTags[ WT_WIDTH  ].ti_Data ) + XOffset + Scr->WBorRight;\n"
  366.                "\twh = ScaleY( WTags[ WT_HEIGHT ].ti_Data ) + YOffset + Scr->WBorBottom;\n"
  367.                "\n"
  368.                "\tif(( WTags[ WT_LEFT ].ti_Data + ww ) > Scr->Width  )\n"
  369.                "\t\tWTags[ WT_LEFT ].ti_Data = Scr->Width  - ww;\n"
  370.                "\tif(( WTags[ WT_TOP  ].ti_Data + wh ) > Scr->Height )\n"
  371.                "\t\tWTags[ WT_TOP  ].ti_Data = Scr->Height - wh;\n"
  372.                "\n"
  373.                "\toldww = WTags[ WT_WIDTH  ].ti_Data;\n"
  374.                "\toldwh = WTags[ WT_HEIGHT ].ti_Data;\n"
  375.                "\tWTags[ WT_WIDTH  ].ti_Data = ww;\n"
  376.                "\tWTags[ WT_HEIGHT ].ti_Data = wh;\n\n" );
  377.  
  378.     FPrintf( Files->Std, "\tWTags[8].ti_Data = (ULONG)Scr;\n"
  379.              "\n\tif( *Wnd = OpenWindowTagList( NULL, &WTags[0] )) {\n"
  380.              "\t\t( *Wnd )->UserPort = %s;\n"
  381.              "\t\tModifyIDCMP( *Wnd, IDCMP );\n"
  382.              "\t}\n\n",
  383.        Files->User2 );
  384.  
  385.     if( IE->SrcFlags & FONTSENSITIVE )
  386.     FPuts( Files->Std, "\tWTags[ WT_WIDTH  ].ti_Data = oldww;\n"
  387.                "\tWTags[ WT_HEIGHT ].ti_Data = oldwh;\n\n" );
  388.  
  389.     FPrintf( Files->Std, "\tif(!( *Wnd ))\n"
  390.              "\t\treturn( 4L );\n\n"
  391.              "\tGT_RefreshWindow( *Wnd, NULL );\n"
  392.              "\treturn( 0L );\n"
  393.              "}\n"
  394.              "\nvoid CloseWndShd( struct Window **Wnd, struct Gadget **GList, struct Menu **Mn )\n"
  395.              "{\n"
  396.              "\tstruct IntuiMessage\t*Msg;\n"
  397.              "\tstruct Node\t\t\t*succ;\n"
  398.              "\n\tif( Mn ) {\n"
  399.              "\t\tif( *Wnd )\n"
  400.              "\t\t\tClearMenuStrip( *Wnd );\n"
  401.              "\t\tFreeMenus( *Mn );\n"
  402.              "\t\t*Mn = NULL;\n"
  403.              "\t}\n"
  404.              "\n\tif( *Wnd ) {\n"
  405.              "\n\t\tForbid();\n"
  406.              "\n\t\tMsg = (struct IntuiMessage *)( *Wnd )->UserPort->mp_MsgList.lh_Head;\n"
  407.              "\t\twhile( succ = Msg->ExecMessage.mn_Node.ln_Succ ) {\n"
  408.              "\t\t\tif( Msg->IDCMPWindow == *Wnd ) {\n"
  409.              "\t\t\t\tRemove(( struct Node *)Msg );\n"
  410.              "\t\t\t\tReplyMsg(( struct Message *)Msg );\n"
  411.              "\t\t\t}\n"
  412.              "\t\t\tMsg = (struct IntuiMessage *)succ;\n"
  413.              "\t\t}\n"
  414.              "\n\t\t( *Wnd )->UserPort = NULL;\n"
  415.              "\t\tModifyIDCMP( *Wnd, 0L );\n"
  416.              "\n\t\tPermit();\n"
  417.              "\n\t\tCloseWindow( *Wnd );\n"
  418.              "\t\t*Wnd = NULL;\n"
  419.              "\t}\n"
  420.              "\n\tif( GList ) {\n"
  421.              "\t\tFreeGadgets( *GList );\n"
  422.              "\t\t*GList = NULL;\n"
  423.              "\t}\n"
  424.              "\n}\n"
  425.              "\n"
  426.              "void HandleIDCMPPort( void )\n"
  427.              "{\n"
  428.              "\tstruct IntuiMsg\t*m;\n"
  429.              "\tvoid\t\t(*func)(void);\n"
  430.              "\n"
  431.              "\twhile( m = GT_GetIMsg( %s )) {\n"
  432.              "\t\tCopyMem((char *)m, (char *)&IDCMPMsg, (long)sizeof( struct IntuiMessage ));\n"
  433.              "\t\tGT_ReplyIMsg( m );\n"
  434.              "\t\tfunc = IDCMPMsg.IDCMPWindow->ExtData;\n"
  435.              "\t\t(*func)();\n"
  436.              "\t}\n"
  437.              "}\n",
  438.             Files->User2 );
  439. }
  440. ///
  441.  
  442.